package com.qingke.besuper.command.impl;

import java.util.List;

import com.qingke.besuper.command.UserCommand;
import com.qingke.besuper.pojo.Question;
import com.qingke.besuper.pojo.User;
import com.qingke.besuper.util.BeSuperConsole;

public class ListOpenQuestionsCommand extends UserCommand{

	public ListOpenQuestionsCommand(User user) {
		super(user);
	}

	@Override
	public void execute() {
		List<Question> arr=dao.getOpenQuestions(true);
		BeSuperConsole.println("------opened questions list------");
		for(Question q:arr){
			BeSuperConsole.println("id:["+q.getId()+"],credit:["+q.getCredit()+"],questioner:["+q.getPlayerId()+"],isOpen:["+q.isOpen()+"],context:"+q.getContext());
		}
	}

}
